package detector;


import java.util.LinkedList;
import java.util.List;
import javax.sql.DataSource;

public class DataSourceDestroyer {

    private static final String THREAD_NAME = "close-datasource";

    private static final long TIMEOUT_CLOSE = 10 * 1000;

    //数据源关闭探测器
    private final List<DataSourceActiveDetector> detectors = new LinkedList<>();

    public void destroy(String name, DataSource dataSource) {
        DataSourceActiveDetector detector = detectors.stream()
            .filter(x -> x.support(dataSource))
            .findFirst()
            .orElse(null);

        long start = System.currentTimeMillis();
        //进行数据库探活

    }
}
